package com.ayx.redispublish.Listener;

import com.ayx.redispublish.vo.MessageDto;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class PrintMessageReceiver {
    @Autowired
    private RedisTemplate redisTemplate;

    /**
     * 第二种方式
     * @param messageDto
     * @param channel
     */
    public void receiveMessage(MessageDto messageDto, String channel) {
        //消息业务处理
        // 接收的topic
        log.info("channel:" + channel);

        log.info("接收到的message:" + messageDto);
    }
}